﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Jayden.Dll.Updater;
using System.IO;

namespace UpdateManifestTool
{
	class Program
	{
		static int Main(string[] args)
		{
			if (args.Length != 3)
				return -1;
			string software = args[0];
			string version = args[1];
			string directory = args[2];

			try
			{
				if (File.Exists(directory + "manifest.txt"))
					File.Delete(directory + "manifest.txt");
				SoftwareVersionInformation info = new SoftwareVersionInformation(directory, software, version);
				info.SaveManifest(directory + "manifest.txt");
			}
			catch(Exception e)
			{
				return -2;
			}

			return 0;
		}
	}
}
